package com.reer;

import android.content.Intent;
import com.reer.http.AbstractHttpController;
import com.reer.http.HttpCallBack;
import com.reer.http.UriConstants;
import com.reer.util.ToastUtils;

/**
 * Created by IntelliJ IDEA.
 * User: Lee
 * Date: 12-4-27
 * Time: 下午1:20
 */
public class ListActivityController extends AbstractHttpController {
    private ListActivity mListActivity;

    public ListActivityController(ListActivity mListActivity){
        super(String.class);
        this.mListActivity =mListActivity;
    }


    @Override
    public void onNetworkAbort() {
        ToastUtils.showMessage(mListActivity,"网络连接被中断");
        mListActivity.hideProgressDialog();
    }

    @Override
    public void onNetworkError() {
        ToastUtils.showMessage(mListActivity,"网络连接错误");
        mListActivity.hideProgressDialog();
    }

    @Override
    public void onResponseError() {
        ToastUtils.showMessage(mListActivity,"服务器返回错误");
        mListActivity.hideProgressDialog();
    }


    public void requestContentList(){
        this.sendRequest(UriConstants.URL,"",new HttpCallBack() {
            @Override
            public void callback(String response) {
                ToastUtils.showMessage(mListActivity,response);
                mListActivity.hideProgressDialog();
            }
        });
    }
}
